#include<iostream>
using namespace std;
const int N = 2e5 + 10;
int arr[N];
int n, k;
struct node
{
	int id;
	int v;
}s[N];	
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		s[i].id = i;
		scanf_s("%d", &s[i].v);
	}
	cin >> k;
	int ans = 0;
	int pos = n + 1;
	int m = 1;
	for (int i = n; i >= m; i--) {
		if (s[i].v > k) {
			pos = i;
		}
		ans++;
		m++;
	}
	cout << ans << endl;
	return 0;
}